package com.ljf.finance.domain.validator;

import com.ljf.common.domain.validator.BasisValidator;
import com.ljf.common.exception.ServiceException;
import com.ljf.common.utils.StringUtil;
import com.ljf.finance.domain.repository.FinanceDatAccountReportTypeRepository;
import com.ljf.finance.dto.command.FinanceDatAccountReportTypeCommand;
import com.ljf.finance.dto.query.FinanceDatAccountReportTypeQuery;
import com.ljf.finance.model.FinanceDatAccountReportType;
import com.ljf.finance.vo.FinanceDatAccountReportTypeVO;
import org.springframework.stereotype.Component;

/**
 * 账户报表类型  业务校验
 *
 * @author LJF
 * @since 2024-12-07
 */
@Component
public class FinanceDatAccountReportTypeValidator extends BasisValidator<FinanceDatAccountReportTypeQuery, FinanceDatAccountReportTypeCommand, FinanceDatAccountReportTypeVO, FinanceDatAccountReportType, FinanceDatAccountReportTypeRepository> {

    /**
     * 报表数据 业务校验
     *
     * @param code
     * @throws ServiceException
     */
    public void checkReportData(String code) throws ServiceException {
        if (StringUtil.isEmpty(code)) {
            throw new ServiceException("报表数据校验异常:请选择报表类型");
        }
    }

}
